<template>
	<view class="txSetUp">
		<view class="item">
			<view class="name">真实姓名</view>
			<input class="inp" v-model.trim="parameter.real_name"></input>
		</view>
		<view v-if="!is_examine" class="item">
			<view class="name">支付宝账号</view>
			<input class="inp" v-model.trim="parameter.alipay_account"></input>
		</view>
		<!-- <view class="item">
			<view class="name">银行卡账号</view>
			<input class="inp" v-model="parameter.value" @confirm="confirm"></input>
		</view> -->
		<!-- <view class="tis">
			<image src="https://miaoyao-oss.oss-cn-hangzhou.aliyuncs.com/profitTool/icon17.png" mode="scaleToFill">
			</image>
			<text>支付宝账号与银行账号只需填写一个即可</text>
		</view> -->
		<view class="btn" @click="editAccount">
			保存
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				parameter: {
					real_name: uni.getStorageSync("user").real_name, //true	string		真实姓名
					alipay_account: uni.getStorageSync("user").alipay_account, //true	string		支付宝账户
				},
				is_examine: uni.getStorageSync("is_examine")
			}
		},
		methods: {
			// 更新提现信息
			async editAccount() {
				if (!this.parameter.real_name || !this.parameter.real_name) {
					uni.showToast({
						title: '真实姓名和账号信息不能为空~',
						icon: 'none'
					})
					return
				}
				let res = await this.$http("api/user/editAccount", this.parameter, "POST")
				console.log(res);
				if (res.code == 200) {
					uni.showToast({
						title: '绑定成功',
						icon: 'none'
					})
					setTimeout(() => {
						this.navigateBack()
					}, 800)
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.txSetUp {
		padding: 24rpx 32rpx;
		height: 100vh;
		box-sizing: border-box;

		.item {
			margin-bottom: 32rpx;

			.name {
				font-weight: bold;
				font-size: 28rpx;
				color: #333333;
				padding-bottom: 24rpx;
			}

			.inp {
				width: 100%;
				height: 72rpx;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				border: 2rpx solid #737373;
				font-weight: 500;
				font-size: 30rpx;
				box-sizing: border-box;
				padding:  0 20rpx;

				.input-placeholder {
					font-weight: 500;
					font-size: 30rpx;
					color: #B6B6B6;
				}
			}
		}

		.tis {
			display: flex;
			align-items: center;

			image {
				width: 24rpx;
				height: 24rpx;
			}

			text {
				font-weight: 500;
				font-size: 20rpx;
				color: #8D8F90;
				padding-left: 8rpx;
			}
		}

		.btn {
			position: fixed;
			bottom: 100rpx;
			width: 686rpx;
			height: 96rpx;
			background: #FF504A;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			line-height: 96rpx;
			text-align: center;
			font-weight: bold;
			font-size: 32rpx;
			color: #FFFFFF;
		}
	}
</style>